package com.hzy.admin.controller.system;

import com.hzy.admin.framework.ApiResult;
import com.hzy.admin.framework.annotation.AdminAuthorization;
import com.hzy.admin.framework.controller.ApiBaseController;
import com.hzy.admin.models.vo.system.UpdatePasswordVo;
import com.hzy.admin.services.system.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 修改密码
 *
 * @author HZY
 */
@Api(tags = "修改密码")
@RestController
@RequestMapping("/admin/change/password")
@AdminAuthorization("f35d64ae-ecb7-4d06-acfb-d91595966d9e")
public class ChangePasswordController extends ApiBaseController<ISysUserService> {
    public ChangePasswordController(ISysUserService service) {
        super(service);
    }

    /**
     * 修改密码
     *
     * @param form
     * @return
     */
    @ApiOperation("修改密码")
    @PostMapping("/saveForm")
    @ResponseBody
    public ApiResult<?> saveForm(@RequestBody UpdatePasswordVo form) {
        this.service.changePassword(form);
        return this.resultOk();
    }

}
